﻿using System.Text.Json.Serialization;
using WebApiClientCore;
using WebApiClientCore.Attributes;
using HttpGetAttribute = WebApiClientCore.Attributes.HttpGetAttribute;
using HttpPostAttribute = WebApiClientCore.Attributes.HttpPostAttribute;

namespace HuanTian.Service
{
    /// <summary>
    /// 测试 WebApiClientCore 连接第三方服务接口
    /// </summary>
    [LoggingFilter]
    [HttpHost("http://8.134.101.25:5566/")]
    public interface ITestThreeService : IHttpApi
    {
        /// <summary>
        /// 登陆接口
        /// </summary>·
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("srm/login")]
        //[Timeout(10 * 1000)]
        ITask<APIResult<string>> Login([JsonContent] TestLoginInput input);
        /// <summary>
        /// 查询数据
        /// </summary>·
        /// <param name="input"></param>
        /// <param name="headers"></param>
        /// <returns></returns>
        [HttpGet("sysApp/page")]
        ITask<APIResult<SysAppPageThreeServiceOutput>> SysAppPage(SysAppPageThreeServiceInput input, [Headers] Dictionary<string, string> headers);
        /// <summary>
        /// 查询数据
        /// </summary>·
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet("sysApp/page")]
        [OAuthToken]
        ITask<APIResult<SysAppPageThreeServiceOutput>> SysAppPageAuth(SysAppPageThreeServiceInput input);
    }
    public class TestLoginInput
    {
        /// <summary>
        /// 用户账号
        /// </summary>
        [JsonPropertyName("account")]
        public string? UserName { get; set; }
        /// <summary>
        /// 用户密码
        /// </summary>
        public string? Password { get; set; }
    }
    public class SysAppPageThreeServiceOutput
    {
        public long Id { get; set; }
        public string Active { get; set; }
        public string Name { get; set; }
        public string Code { get; set; }
        public int Sort { get; set; }
    }
    public class SysAppPageThreeServiceInput : IPageInput
    {
        public int PageSize { get; set; }
        public int PageNo { get; set; }
    }


}
